package com.cool.modules.finance.service.order.impl;

import com.cool.core.base.BaseServiceImpl;
import com.cool.modules.finance.entity.order.FinanceOrderImgEntity;
import com.cool.modules.finance.mapper.order.FinanceOrderImgMapper;
import com.cool.modules.finance.service.order.FinanceOrderImgService;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FinanceOrderImgServiceImpl extends BaseServiceImpl<FinanceOrderImgMapper, FinanceOrderImgEntity> implements FinanceOrderImgService {
    @Override
    public void updateImgList(Long orderId, List<FinanceOrderImgEntity> entity) {
        mapper.deleteByQuery(new QueryWrapper().eq(FinanceOrderImgEntity::getOrderId, orderId));
        mapper.insertBatch(entity);
    }
}
